package com.lck.main.game;

import com.lck.main.view.GamePanel;

import java.awt.*;

public class Bing extends Chess{
    public Bing(int player, Point p) {
        super("bing", player, p);
    }

    public Bing(int player, int px) {
        this(player, new Point(px,4));
    }

    @Override
    public boolean isAbleMoved(Point tp, GamePanel gamePanel) {
        if (line(tp) < 2 || getStep(tp) > 1){
            return false;
        }
        if(isOverRiver(p)){//当前位置是否过河，这是与象的区别
            return !isBack(tp);
        } else {
            return isForward(tp);
        }
    }
}
